package router

import (
	"gin-skeleton/app/controller/web"
	"gin-skeleton/etc"
	"github.com/gin-gonic/gin"
)

func loadViewTemplate(r *gin.Engine) {
	if !etc.Load().View.Enable {
		return
	}
	r.LoadHTMLGlob("./views/*")
}

func InitWebRouter(r *gin.Engine) {
	loadViewTemplate(r)

	// 根Url
	r.GET("/", web.Home{}.Index)
}
